﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using DataContracts;

namespace ServiceContracts
{
    /// <summary>
    /// Define Service Interface
    /// </summary>
    [ServiceContract]
    public interface IService
    {
        
        [OperationContract]
        List<RoleDTO> GetAllRole(string roleName, int status);
        [OperationContract]
        List<RoleDTO> GetAllUserRole();
        [OperationContract]
        [FaultContract(typeof(FaultException))]
        void DeleteRole(int roleId);
        [OperationContract]
        void BatchUpdateRoleStatus(List<RoleDTO> roleList);
        [OperationContract]
        [FaultContract(typeof(FaultException))]
        RoleDTO GetRoleById(int roleId);
        [OperationContract]
        List<StatusDTO> GetAllRoleStatus();
        [OperationContract]
        StatusDTO GetRoleStatusById(int statusId);
        [OperationContract]
        [FaultContract(typeof(FaultException))]
        void UpdateRole(RoleDTO role);
        [OperationContract]
        [FaultContract(typeof(FaultException))]
        void AddNewRole(RoleDTO role);
        [OperationContract]
        List<RoleViewDTO> SearchRole(string roleName, string status, string authorities, string sortExpression, string sortDirection, double PageSize, int PageIndex, out int pageCnt);


        [OperationContract]
        bool AddNewAuthority(AuthorityDTO authority);
        [OperationContract]
        [FaultContract(typeof(FaultException))]
        bool DeleteAuthority(int authorityId);
        [OperationContract]
        [FaultContract(typeof(FaultException))]
        bool UpdateAuthority(AuthorityDTO authority);
        [OperationContract]
        [FaultContract(typeof(FaultException))]
        AuthorityDTO GetAuthorityById(int authorityId);
        [OperationContract]
        List<AuthorityLevelDTO> GetAllAuthorityLevel();
        [OperationContract]
        List<AuthorityDTO> GetAllAuthority();
        [OperationContract]
        List<AuthorityDTO> SearchAuthority(string authorityName , int levelId);


        [OperationContract]
        [FaultContract(typeof(FaultException))]
        bool AddNewUser(UserDTO user);
        [OperationContract]
        [FaultContract(typeof(FaultException))]
        void DeleteUser(int userId);
        [OperationContract]
        [FaultContract(typeof(FaultException))]
        void UpdateUser(UserDTO user);
        [OperationContract]
        List<UserDTO> GetAllUser();
        [OperationContract]
        List<DepartmentDTO> GetAllDepartment();
        [OperationContract]
        UserDTO GetUserById(int userId);
        [OperationContract]
        List<UserDTO> SearchUser(int departmentId, string firstName,string lastName);
    }
}
